#include "widget.h"
#include "ui_widget.h"
#include"QAbstractButton"
#include"QButtonGroup"
Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);
    QButtonGroup* group1 = new QButtonGroup(this);
     QButtonGroup* group2 = new QButtonGroup(this);
     group1->addButton(ui->radioButton);
      group1->addButton(ui->radioButton_2);
      group1->addButton(ui->radioButton_3);
      group2->addButton(ui->radioButton_4);
      group2->addButton(ui->radioButton_5);
      group2->addButton(ui->radioButton_6);
}

Widget::~Widget()
{
    delete ui;
}


void Widget::on_radioButton_clicked()
{
     ui->label->setText("你选择的主食为：青椒肉丝炒饭");
}

void Widget::on_radioButton_2_clicked()
{
    ui->label->setText("你选择的主食为：鱼香肉丝炒饭");
}

void Widget::on_radioButton_3_clicked()
{
    ui->label->setText("你选择的主食为：番茄牛腩盖饭");
}

void Widget::on_radioButton_4_clicked()
{
    ui->label_2->setText("你选择的饮料为：雷碧");
   }

void Widget::on_radioButton_5_clicked()
{
    ui->label_2->setText("你选择的饮料为：茶几");
}

void Widget::on_radioButton_6_clicked()
{
    ui->label_2->setText("你选择的饮料为：热红茶");
}
